package com.cs.service.admin.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cs.mapper.AdminMapper;
import com.cs.mapper.UserMapper;
import com.cs.pojo.Administrator;
import com.cs.pojo.Goods;
import com.cs.pojo.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Administrator> implements IAdministratorService{
    @Autowired
    private AdminMapper adminMapper;
    @Override
    public IPage<Administrator> getPage(int currentPage, int pageSize) {
        IPage<Administrator> page=new Page<Administrator>(currentPage,pageSize);
        adminMapper.selectPage(page,null);
        return page;
    }

    @Override
    public IPage<Administrator> getPage(int currentPage, int pageSize, Administrator administrator) {
        LambdaQueryWrapper<Administrator> lambdaQueryWrapper=new LambdaQueryWrapper<Administrator>();
        IPage<Administrator> page=new Page<Administrator>(currentPage,pageSize);
        adminMapper.selectPage(page,lambdaQueryWrapper);
        return page;
    }

}
